
#include "graf.h"

#include <stdio.h>
#include <signal.h>
#include <string.h>

void install_handler(void (*f)(int))
{
    struct sigaction sa;
    memset(&sa, 0, sizeof(sa));
    sa.sa_handler = f;
    sa.sa_flags = SA_SIGINFO;

    sigaction(SIGINT, &sa, NULL);
    printf("handler installed\n");
}
